/* SocialPage.css - 社交页面组件样式（包含置顶功能） */

.social-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 社交页面头部 */
.social-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-glass);
}

.social-title h1 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-white);
    margin-bottom: var(--spacing-sm);
}

.social-title p {
    color: var(--text-gray-light);
}

.create-post-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to right, var(--primary-purple), var(--primary-blue));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.create-post-btn:hover {
    background: linear-gradient(to right, var(--purple-dark), var(--blue-dark));
    transform: translateY(-1px) scale(1.02);
}

/* 帖子列表 */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.empty-posts {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-glass-light);
    border-radius: var(--radius-lg);
    color: var(--text-gray-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

/* 帖子卡片 */
.post-card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-glass);
    transition: all 0.3s ease;
    position: relative;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* ========== 置顶帖子样式 ========== */
.post-card.sticky-post {
    background: linear-gradient(135deg,
    rgba(255, 215, 0, 0.1),
    rgba(255, 165, 0, 0.05)
    );
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.post-card.sticky-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #ffa500, #ff8c00);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.post-card.sticky-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.6);
}

/* 置顶标识 */
.sticky-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #8b4513;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
    }
    to {
        box-shadow: 0 4px 16px rgba(255, 215, 0, 0.6);
    }
}

/* 置顶指示器 */
.sticky-indicator {
    margin-left: var(--spacing-xs);
    font-size: 0.875rem;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-2px); }
}

.sticky-title-indicator {
    margin-left: var(--spacing-sm);
    color: #ffd700;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.sticky-title-indicator-large {
    margin-left: var(--spacing-sm);
    color: #ffd700;
    font-size: 1.25rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* 置顶模态框样式 */
.modal-content.sticky-modal {
    border: 2px solid rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg,
    var(--bg-glass),
    rgba(255, 215, 0, 0.02)
    );
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.2);
}

.sticky-modal-badge {
    margin-left: var(--spacing-sm);
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #8b4513;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========== 原有样式继续 ========== */

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    background: linear-gradient(45deg, var(--primary-purple), var(--primary-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-white);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.post-time {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.post-content {
    margin-bottom: var(--spacing-lg);
}

.post-title {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.post-card.sticky-post .post-title {
    color: #fff2cc;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.post-text {
    color: var(--text-gray-light);
    line-height: 1.6;
    font-size: 0.9rem;
}

.post-card.sticky-post .post-text {
    color: #f5f5dc;
}

.post-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-glass-light);
}

.post-card.sticky-post .post-actions {
    border-top-color: rgba(255, 215, 0, 0.2);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-glass-light);
    color: var(--text-gray-light);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.action-btn:hover:not(:disabled) {
    background: var(--bg-glass);
    color: var(--text-white);
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.like-btn.liked {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-light);
}

.comment-btn {
    color: var(--purple-light);
}

.detail-btn {
    background: linear-gradient(to right, var(--primary-purple), var(--primary-blue));
    color: var(--text-white);
}

.detail-btn:hover {
    background: linear-gradient(to right, var(--purple-dark), var(--blue-dark));
}

/* 置顶帖子的按钮样式优化 */
.post-card.sticky-post .action-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.post-card.sticky-post .action-btn:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4);
    color: #fff;
}

/* 创建帖子表单 */
.create-post-form {
    padding: var(--spacing-lg);
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-top: var(--spacing-xs);
}

/* 帖子详情 */
.post-detail {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-glass-light);
}

.post-detail-header {
    margin-bottom: var(--spacing-lg);
}

.post-detail-content {
    margin-bottom: var(--spacing-lg);
}

.post-detail-title {
    color: var(--text-white);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.post-detail-text {
    color: var(--text-gray-light);
    line-height: 1.7;
    font-size: 1rem;
    white-space: pre-wrap;
}

.post-detail-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-glass-light);
}

.comment-count {
    color: var(--purple-light);
    cursor: default;
}

/* 评论区 */
.comments-section {
    padding: var(--spacing-lg);
}

.comments-section h3 {
    color: var(--text-white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.comment-form {
    margin-bottom: var(--spacing-xl);
}

.comment-input {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-white);
    resize: none;
    font-family: inherit;
    margin-bottom: 0.75rem;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.5);
}

.comment-input::placeholder {
    color: var(--text-gray);
}

.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.empty-comments {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-gray);
    font-style: italic;
}

.comment-item {
    background: var(--bg-glass-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background: linear-gradient(45deg, var(--primary-purple), var(--primary-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.comment-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-weight: 500;
    color: var(--text-white);
    font-size: 0.875rem;
}

.comment-time {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.comment-content {
    color: var(--text-gray-light);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* 置顶帖子数量提示 */
.sticky-posts-indicator {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    text-align: center;
    color: #ffd700;
    font-size: 0.875rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .social-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }

    .create-post-btn {
        width: 100%;
        justify-content: center;
    }

    .post-actions {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .action-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .comment-form-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .post-detail-title {
        font-size: 1.5rem;
    }

    .sticky-badge {
        position: static;
        margin-bottom: var(--spacing-sm);
        align-self: flex-start;
    }

    .post-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .sticky-title-indicator,
    .sticky-title-indicator-large {
        margin-left: 0;
        margin-top: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .social-container {
        padding: 0;
    }

    .social-header {
        margin: 0 0 var(--spacing-md) 0;
        border-radius: var(--radius-md);
    }

    .post-card {
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
    }

    .post-card.sticky-post {
        padding-top: calc(var(--spacing-md) + 2rem);
    }

    .sticky-badge {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        font-size: 0.7rem;
        padding: var(--spacing-xs);
    }

    .post-title {
        font-size: 1.125rem;
    }

    .action-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }

    .sticky-indicator {
        font-size: 0.75rem;
    }

    .sticky-title-indicator {
        font-size: 0.875rem;
    }

    .sticky-title-indicator-large {
        font-size: 1rem;
    }
}